package c1760;

import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class F {
    public static void main(String[] args) {
        while (cin.hasNext()) {
            String s = cin.next();
            char[] chars = s.toCharArray();
            Arrays.sort(chars);
            char maxChar = chars[chars.length - 1];//""+maxChar
            System.out.println(s.replace(Character.toString(maxChar), maxChar+"(max)"));
        }

        cin.close();
        cout.close();
    }


    static Scanner cin = new Scanner(System.in);//Alt+Enter
    static PrintWriter cout = new PrintWriter(System.out);
    static PrintWriter cerr = new PrintWriter(System.err, true);

}
